const execSync = require('child_process').execSync;
const spawn = require('cross-spawn');
const args = process.argv.slice(2);

const msg = Array.isArray(args) ? args[0] : 'fix: bugs'

execSync('git add -A')

spawn.sync('git', ['commit', '-a', '-m', msg])

execSync('git push')

execSync('nrm use npm')

spawn.sync('npx', ['lerna', 'publish'])
